]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
ScreenShield: properly handle ensureUnlockDialog() failure
authorGiovanni Campagna <gcampagna@src.gnome.org>
Sat, 8 Jun 2013 14:03:14 +0000 (16:03 +0200)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Wed, 7 Aug 2013 08:33:14 +0000 (10:33 +0200)
If that fails (which only ever happens in initial-setup mode, which
has no unlock or login dialog), we don't want to go ahead with
whatever we were doing.

https://bugzilla.gnome.org/show_bug.cgi?id=701848

js/ui/screenShield.js

index 4e61c1115f741fc85b9721fe8e46afde4a481776..89601c0ea441f6cd31c5889f9e73102f7f11272d 100644 (file)
@@ -583,8 +583,8 @@ const ScreenShield = new Lang.Class({
 
     _liftShield: function(onPrimary, velocity) {
         if (this._isLocked) {
-            this._ensureUnlockDialog(onPrimary, true /* allowCancel */);
-            this._hideLockScreen(true /* animate */, velocity);
+            if (this._ensureUnlockDialog(onPrimary, true /* allowCancel */))
+                this._hideLockScreen(true /* animate */, velocity);
         } else {
             this.deactivate(true /* animate */);
         }
@@ -621,9 +621,8 @@ const ScreenShield = new Lang.Class({
         if (!isEnter && !(GLib.unichar_isprint(unichar) || symbol == Clutter.KEY_Escape))
             return false;
 
-        this._ensureUnlockDialog(true, true);
-
-        if (GLib.unichar_isgraph(unichar))
+        if (this._ensureUnlockDialog(true, true) &&
+            GLib.unichar_isgraph(unichar))
             this._dialog.addCharacter(unichar);
 
         this._liftShield(true, 0);
@@ -864,8 +863,8 @@ const ScreenShield = new Lang.Class({
         this.actor.show();
         this._isGreeter = Main.sessionMode.isGreeter;
         this._isLocked = true;
-        this._ensureUnlockDialog(true, true);
-        this._hideLockScreen(false, 0);
+        if (this._ensureUnlockDialog(true, true))
+            this._hideLockScreen(false, 0);
     },
 
     _hideLockScreenComplete: function() {
@@ -915,7 +914,7 @@ const ScreenShield = new Lang.Class({
             if (!constructor) {
                 // This session mode has no locking capabilities
                 this.deactivate(true);
-                return;
+                return false;
             }
 
             this._dialog = new constructor(this._lockDialogGroup);
@@ -927,12 +926,14 @@ const ScreenShield = new Lang.Class({
                 // by the time we reach this...
                 log('Could not open login dialog: failed to acquire grab');
                 this.deactivate(true);
+                return false;
             }
 
             this._dialog.connect('failed', Lang.bind(this, this._onUnlockFailed));
         }
 
         this._dialog.allowCancel = allowCancel;
+        return true;
     },
 
     _onUnlockFailed: function() {